<?php $result = perb_select_corelate2($key, 
		"b.DEPERB_STATUS='$status' AND a.LAPOR_ID='$laporID' AND a.PERB_PRIVILEGES='$username'", $orderby=false);?>
<?php while ($row = mysql_fetch_assoc($result)):?>
<tr <?php echo tag_zebra($z++)?>>
	<td align="center"><?php echo $row['PERB_TGL']. " " .$row['PERB_WAKTU']?></td>
	<td align="center"><?php echo $row['DEPERB_TGL']. " " .$row['DEPERB_WAKTU']?></td>
	<td align="center"><?php echo $row['NAMA_KARYAWAN']?></td>
    <td align="center"><?php echo $row['ACHIEV_BIDANG']?></td>
    <td align="center"><?php echo $row['DETACHIEV_TINGKAT']?></td>
    <td align="center"><?php echo $row['DETACHIEV_NAMA']?></td>
    <td align="center">
		<?php if ($row['DEPERB_STATUS']==0):?>
        <span>Pending</span>
    	<?php elseif ($row['DEPERB_STATUS']==1): ?>
		<span>Denied</span>
		<?php else:?>
        <span>Approve</span>
        <?php endif;?>
    </td>
	<td align="right">
		<a class="marginL5" onclick="FBModal_show2(APP.action, 'post', 'proc=keterangan-modal&deperbNO=<?php echo $row['DEPERB_NO']?>', true, true);">Keterangan</a>
    	<a class="marginL5" onclick="perbuatan_dokumen('<?php echo $row['DEPERB_NO']?>')">Dokumen</a>
        <?php if($row['PERB_PRIVILEGES']==$username && $row['DEPERB_STATUS']!=2) : ?>
    	<a class="marginL5" onclick="perbuatan_delete('<?php echo $row['PERB_NO']?>')">Delete</a>
        <?php endif;?>
    </td>
</tr>
<?php endwhile; return;?>
<!--
<?php while ($row = mysql_fetch_assoc($result)):?>
<tr <?php echo tag_zebra($z++)?>>
	<?php $pelapor = mysql_fetch_assoc(pelapor_load($row['LAPOR_ID'])); ?>
    <?php $detachiev = mysql_fetch_assoc(deprepel_load($row['DETACHIEV_ID']))?>
    <?php $achiev = mysql_fetch_assoc(perpel_select($detachiev['ACHIEV_ID']))?>
    <?php $kary = mysql_fetch_assoc(kary_load($row['KODE_KARYAWAN']))?>
    
	<td align="center"><?php echo $row['PERB_TGL']. " " .$row['PERB_WAKTU']?></td>
    <td align="center"><?php echo $pelapor['LAPOR_NAMA']?></td>
	<td align="center"><?php echo $row['DEPERB_TGL']. " " .$row['DEPERB_WAKTU']?></td>
	<td align="center"><?php echo $kary['NAMA_KARYAWAN']?></td>
    <td align="center"><?php echo $achiev['ACHIEV_BIDANG']?></td>
    <td align="center"><?php echo $detachiev['DETACHIEV_TINGKAT']?></td>
    <td align="center"><?php echo $detachiev['DETACHIEV_NAMA']?></td>
    <td align="center">
    	<?php $status = array('Pending', 'Denied', 'Approve')?>
        <span><?php echo $status[$row['DEPERB_STATUS']]?></span>
    </td>
	<td align="center">
    	<a class="marginL5" onclick="perbuatan_dokumen('<?php echo $row['DEPERB_NO']?>')">Dokumen</a>
</tr>
<?php endwhile;?>-->